﻿using Domain.Repository.Repositories;

namespace Domain.Repository
{
    public static class Registry
    {
        private static IGroupRepository groupRepository;

        private static IRepositoryFactory RepositoryFactory
        {
            get
            {
                return new Domain.Repository.Implementations.NHibernate.RepositoryFactory();
            }
        }

        public static IGroupRepository GroupRepository
        {
            get
            {
                if (groupRepository == null)
                {
                    groupRepository = RepositoryFactory.CreateGroupRepository();
                }
                return groupRepository;
            }
        }
    }
}
